class bigint{
private:
    string rnum; //字符串私有防止外部修改破坏结构
public:
    void delete_pre_zero(string &znum) { //删去一个正序存储数字符串的前缀0
        int pos=0;
        for (int i=0;i<znum.size();i++) {
            if (znum[i]-'0') {
                break;
            }else {
                pos++;
            }
        }

        znum=znum.substr(pos);
    }

    bigint operator*(const long long p){ //高精度乘低精度
        long long z=0;
        string ans;
        for(int i=0;i<rnum.size();i++){
            ll num=(rnum[i]-'0')*p;
            num+=z;
            z=num/10;
            num%=10;
            ans+=num+'0';
        }

        while(z){
            ans+=z%10+'0';

            z/=10;
        }

        reverse(ans.begin(),ans.end());
        return bigint(ans);
    }

    bigint operator/(const int p) { //高精度除低精度
        ll remainder=0;
        string ans;

        string num(rnum.rbegin(),rnum.rend());
        ll curr=0;
        for (int i=0;i<num.size();i++) {
            curr*=10;
            curr+=num[i]-'0';
            ans+=curr/p+'0';
            curr%=p;
        }
        delete_pre_zero(ans);

        return bigint(ans);
    }

    bigint(string &num){ //带参构造 输入正序存储的字符串
        rnum=str;

        delete_pre_zero(rnum); //删去正序存储的前缀0
        reverse(rnum.begin(),rnum.end()); //将正序存储修改为逆序存储
    }

    bigint(){ //无参构造用开辟bigint型数组 或使用容器
        rnum="";
    }

    string out(){ //将一个bigint类型的对象以正序字符串类型返回
        string num(rnum.rbegin(),rnum.rend());
        return num;
    }
};